package com.lzj.service;

import com.lzj.dao.MeetingMapper;
import com.lzj.entity.Meeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @autor:lzj
 * @date:2022/3/1
 */
@Service
public class MeetingServiceImpl implements MeetingService{
    @Autowired
    private MeetingMapper meetingMapper;

    public void setMeetingMapper(MeetingMapper meetingMapper) {
        this.meetingMapper = meetingMapper;
    }

    @Override
    public int addMeeting(Meeting meeting) {
        return meetingMapper.addMeeting(meeting);
    }

    @Override
    public int addParticipants(int meetingid, int[] mps) {
        return meetingMapper.addParticipants(meetingid,mps);
    }

    @Override
    public Long getTotal(Meeting meeting, List<Integer> empsIdByDepName, List<Integer> mrIdByName) {
        return meetingMapper.getTotal(meeting,empsIdByDepName,mrIdByName);
    }

    @Override
    public List<Meeting> getAllMeeting(Meeting meeting, List<Integer> empsIdByDepName, List<Integer> mrIdByName, int page, int pageSize) {
        return meetingMapper.getAllMeeting(meeting,empsIdByDepName,mrIdByName,page,pageSize);
    }

    @Override
    public Meeting getMeetingById(int meetingid) {
        return meetingMapper.getMeetingById(meetingid);
    }

    @Override
    public List<Meeting> getMybookings(int reservationistid, String status) {
        return meetingMapper.getMybookings(reservationistid,status);
    }

    @Override
    public int updateMeetingStatusById(Meeting meeting, Date canceledtime, String status) {
        return meetingMapper.updateMeetingStatusById(meeting,canceledtime,status);
    }

    @Override
    public List<Meeting> getMeetingByMtIdAndSta(List<Integer> meetingByEmpId,int employeeid, String status) {
        return meetingMapper.getMeetingByMtIdAndSta(meetingByEmpId,employeeid,status);
    }
}
